#ifndef NR_USER_ROLE_MANAGER_H
#define NR_USER_ROLE_MANAGER_H

/**
 * @file nr_user_role_manager.h
 * @brief nr_user_role_manager is a manager class that 
 * control the user and role objects
 */

#include "nr_std.h"
#include "nr_user.h"
#include "nr_role.h"
#include "nr_user_group.h"
#include "nr_manager_base.h"

/**
 * Manage the user and role objects 
 */
class nr_user_role_manager : public nr_manager_base
{
public:
    /**
     * Default constructor
     */
    nr_user_role_manager();

    /**
     * Destructor
     */
    ~nr_user_role_manager();
    
    /**
     * Load the user and role objects from the disks/database
     */
    virtual nr_error_t load();
    
    /**
     * Unload the user and role objects
     */
    virtual nr_error_t unload();
    
    /**
     * Get the role list reference 
     * Add or remove role by the returned object
     */
    nr_roles& roles() { return m_roles; }
    
    /**
     * Get the user list reference 
     * Add or remove user by the returned object
     */
    nr_users& users() { return m_users; }
    
private:
    nr_roles m_roles;
    nr_users m_users;
};

#endif // NR_USER_ROLE_MANAGER_H
